package response

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

// 返回方法
func ReturnJsonOk(c *gin.Context, params ...interface{}) {
	leng := len(params)
	switch leng {
	case 1:
		c.JSON(http.StatusOK, gin.H{
			"code": 0,
			"message": params[0],
			"data": "",
		})
		break
	case 2:
		c.JSON(http.StatusOK, gin.H{
			"code": 1,
			"message": params[0],
			"data": params[1],
		})
		break
	case 3:

		break
	}
}

func ReturnJsonByStatus(c *gin.Context, status int) {
	c.JSON(status, gin.H{})
}
